#pragma once
#ifndef __SHOW_LIST_MANAGER_H
#define __SHOW_LIST_MANAGER_H

#include <vector>
#include "Singleton.h"
#include "BaseException.h"

// S...L...M => 19 + 12 + 13 = 0x2C
class ShowListManagerError : public BaseException
{
public:
  // Define errCodes
  static const short SHOW_LIST_FULL_ERROR = 0x2C00;
  static const short SHOW_LIST_NOT_FOUND = 0x2C01;

  ShowListManagerError ()
  {
    __errMap.insert (std::make_pair (SHOW_LIST_FULL_ERROR, "You can only have 65535 show lists"));
    __errMap.insert (std::make_pair (SHOW_LIST_NOT_FOUND, "Show list of the specified name is not found"));
  }
};





class ShowListManager : public Singleton< ShowListManager >
{
private:
  struct ShowListInfo { unsigned int nextFree; std::string name; };
  std::vector< ShowListInfo > _showListContainer;

public:
  ShowListManager(void);
  ~ShowListManager(void);

  void createNewList (std::string name, unsigned int mode);
  unsigned int getList (std::string name);
  void deleteList (std::string name);
};

#endif